package com.javaweb.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @desc:
 * @author: Ping
 * @date: 2024/11/23 11:22
 */
@Configuration
public class ServletContextConfig implements WebMvcConfigurer {
    // register interceptor
//        @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//
//        registry.addInterceptor(new AuthInterceptor(permService))
//                .addPathPatterns("/**")
//                .excludePathPatterns("/**/login/**")
//                .excludePathPatterns("/**/error/**");
//    }

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**")
                .addResourceLocations("classpath:/static/");
    }

}
